import React, { useEffect, useState } from 'react'
import axios from '../../api/api'
import { useParams } from 'react-router-dom'
function Index() {
    const {id}=useParams()
    const [list,setList]=useState([])
    const getDataxq=async()=>{
        const res=await axios.get('/api/list/detail',{
            params:{
                id:id
            }
        })
        console.log(res.data)
        setList(res.data.data)
    }
    useEffect(()=>{
        getDataxq()
    },[])
  return (
    <div>
      <div>
    list&&{
         
      <dl>
        <dt>
        <h2>{list.title}</h2>
        <h2>{list.price}</h2>
        </dt>
        <dd></dd>
      </dl>
        }
      </div>
    </div>
  )
}

export default Index
